class PaulsController < ApplicationController
  # GET /pauls
  # GET /pauls.xml
  def index
    @pauls = Paul.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @pauls }
    end
  end

  # GET /pauls/1
  # GET /pauls/1.xml
  def show
    @paul = Paul.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @paul }
    end
  end

  # GET /pauls/new
  # GET /pauls/new.xml
  def new
    @paul = Paul.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @paul }
    end
  end

  # GET /pauls/1/edit
  def edit
    @paul = Paul.find(params[:id])
  end

  # POST /pauls
  # POST /pauls.xml
  def create
    @paul = Paul.new(params[:paul])

    respond_to do |format|
      if @paul.save
        flash[:notice] = 'Paul was successfully created.'
        format.html { redirect_to(@paul) }
        format.xml  { render :xml => @paul, :status => :created, :location => @paul }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @paul.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /pauls/1
  # PUT /pauls/1.xml
  def update
    @paul = Paul.find(params[:id])

    respond_to do |format|
      if @paul.update_attributes(params[:paul])
        flash[:notice] = 'Paul was successfully updated.'
        format.html { redirect_to(@paul) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @paul.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /pauls/1
  # DELETE /pauls/1.xml
  def destroy
    @paul = Paul.find(params[:id])
    @paul.destroy

    respond_to do |format|
      format.html { redirect_to(pauls_url) }
      format.xml  { head :ok }
    end
  end
end
